#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author:Summerday

import networkx as nx
from matplotlib import pyplot as plt

plt.rcParams.update({
	'figure.figsize': (7.5, 7.5),
	'axes.spines.right': False,
	'axes.spines.left': False,
	'axes.spines.top': False,
	'axes.spines.bottom': False})

import random
from numpy import random as nprand
seed = hash("Network Science in Python") % 2**32
nprand.seed(seed)
random.seed(seed)

G = nx.karate_club_graph()
karate_pos = nx.spring_layout(G,k = 0.3) # 节点直接通过一条边连接，将会靠的更近
plt.figure()
nx.draw_networkx(G,karate_pos)
plt.show()


nodes = list(G.nodes)
edges = list(G.edges)